import Router from "koa-router";
import { getControllers,regControllers } from '../utils/tools.js'
import bodyParser from "koa-bodyparser";
import cors from '@koa/cors';



let router = new Router()

export const useControllers = function(app){
    app.use(cors());
    app.use(bodyParser());
    let controllerFile = getControllers();
    regControllers(router,controllerFile)
    app.use(router.routes())
}